<TABLE WIDTH="800" BORDER="0" CELLSPACING="0" CELLPADDING="0" ID="Table1">
	<TR>
		<TD class="N-TopLineBG">
			<img src="<%#VirtualDirectory%>/images/spacer.gif" width="10" height="10">
		</TD>
	</TR>
	<TR align="left">
		<TD HEIGHT="40" BACKGROUND="<%#VirtualDirectory%>/images/HEADBG.GIF" Class="N-LogoBG" align="left">
			<table width="790" height="35" border="0" align="center" cellpadding="0" cellspacing="0" ID="Table2">
				<TR>
					<td width="180" align="left"><img src="<%#VirtualDirectory%>/images/skeltaworkflowlogo.gif"></td>
					<td width="570"><div align="right" class="heading1">Report</div>
					</td>
				</TR>
			</table>
		</TD>
	</TR>
	<TR align="left">
		<TD HEIGHT="40" BACKGROUND="<%#VirtualDirectory%>/images/HEADBG.GIF" Class="N-LogoBG" align="left">
			<TABLE CLASS="TABLEBG" CELLSPACING="1" CELLPADDING="5" WIDTH="100%" BORDER="0" ID="Table3">
				<TR Class="N-MainBGColor">
					<TD colspan="5" class="heading2">
						<B>Report View: Query Builder
					</TD>
				</TR>
			</TABLE>
		</TD>
	</TR>
	<TR bgcolor="AliceBlue">
		<TD colspan="5" class="heading2">
			<TABLE bgcolor="AliceBlue" CELLSPACING="1" CELLPADDING="3" WIDTH="100%" BORDER="0" ID="Table4">
					<TR bgcolor="AliceBlue">
						<a href="#" onclick="javascript:GoBack()">Back to Report Filter</a>
					</TR>
			</TABLE>


		</TD>
	</TR>
	<TR>
		<TD>
			<TABLE CLASS="TABLEBG" CELLSPACING="1" CELLPADDING="5" WIDTH="100%" BORDER="0" ID="Table4">
				<TR CLASS="N-TopRowBG">
					<!--Loaded from ReportQueryLevelApplication.htm-->
					<input type="hidden" name="application" value="<%#applicationhiddenname%>" ID="Hidden2">
					<%#application%>
					<!--Loaded from ReportQueryLevelWorkflow.htm-->
					<input type="hidden" name="workflow" value="<%#workflowhiddenname%>" ID="Hidden1">
					<%#workflow%>
					<input type="hidden" name="reporttype" value="<%#reporttypehiddenname%>">
					<!--Loaded from ReportQueryLevelReportType.htm-->
					<%#reporttype%>
					<input type="hidden" name="datecorrectionfactor" value="<%#datecorrectionfactor%>">
					<input type="hidden" name="display" value="<%#displayvalue%>">
				</TR>
			</TABLE>
		</TD>
	</TR>
	<TR bgcolor="AliceBlue">
		<TD colspan="5" class="heading2"><IMG src="<%#VirtualDirectory%>/images/spacer.gif" height="5"></TD>
	</TR>
	<TR>
		<TD colspan="5">
			<TABLE CLASS="TABLEBG" CELLSPACING="1" CELLPADDING="5" WIDTH="100%" BORDER="0" ID="Table5">
				<TR CLASS="N-TopRowBG">
					<TD width="18%" CLASS="runtext1">
						Search By Saved<br>
						Report Set.
					</TD>
					<TD align="left" colspan="2">
						<SELECT name="selsavedsearch" class="select1" ID="Select1" onchange="javascript:SetReportSet(this.value,this.form)">
							<option value="0">Select Saved Report Set</option>
							<%#savedreportset%>
							<input type=hidden name="ReportSetIdentifier" value="">
						</SELECT>
						<%#ErrReportSets%>
					</TD>
				</TR>
			</TABLE>
		</TD>
	</TR>
	<TR bgcolor="AliceBlue">
		<TD colspan="5" class="heading2"><IMG src="<%#VirtualDirectory%>/images/spacer.gif" height="5"></TD>
	</TR>
	<TR>
		<TD>
			<TABLE CLASS="TABLEBG" CELLSPACING="1" HEIGHT="100%" CELLPADDING="5" WIDTH="100%" BORDER="0" ID="Table6">
				<TR class="N-ListBGCOLORCOL1">
					<TD CLASS="runtext1" width="25%">
						<B>Query On</B>
					</TD>
					<TD CLASS="runtext1" width="13%">
						<B>Operators</B>
					</TD>
					<TD CLASS="runtext1" width="13%">
						<B>Fields</B>
					</TD>
					<TD CLASS="runtext1" width="40%">
						<B>Value</B>
					</TD>
					<TD align="left" width="13%">
						<B>Condition</B>
					</TD>
				</TR>
				<TR class="N-ListBGCOLORCOL2">
					<TD CLASS="runtext1" width="25%">
						<SELECT name="selquery" id="selquery" class="select1" onchange="javascript:listoperators(this.value)">
							<OPTION value="0">Select Query Field</OPTION>
							<OPTION value="(">'('</OPTION>
							<%#queryfields%>
						</SELECT>
					</TD>
					<TD CLASS="runtext1" width="13%">
						<SELECT name="seloperator" id="seloperator" class="select1">
						</SELECT>
					</TD>
					<TD CLASS="runtext1" width="13%">
						<SELECT name="selvalue" id="selvalue" class="select1" onchange="ChangeInputField(this.value);">
						</SELECT>
					</TD>
					<TD CLASS="runtext1" width="40%">
						<div id="expr2">&nbsp;</div>
					</TD>
					<TD align="left" width="13%">
						<SELECT id="selcondition" name="selcondition" class="select1">
							<OPTION value="End" selected>End</OPTION>
							<OPTION value=" And ">And</OPTION>
							<OPTION value=" Or ">Or</OPTION>
							<OPTION value=") And ">')' And</OPTION>
							<OPTION value=") Or ">')' Or</OPTION>
						</SELECT>
					</TD>
				</TR>
				<TR class="N-ListBGCOLORCOL1">
					<TD colspan="5">
						<INPUT type="checkbox" value="" name="btnSaveSet" ID="Submit1" onclick="javascript:if(this.checked) {return SetName();}"> Save Report Set
						<input type=hidden name="hiddenreportset" value="">
						<input type=hidden name="hiddenreportsetfromdynamicvalueset" value="">
						<IMG src="<%#VirtualDirectory%>/images/spacer.gif" height="1" width="500">
						<!--onclick="return Button1_onclick();"-->
						<INPUT id="button1" class="button3" type="submit" value=" Add " name="Button1" onclick="return Button1_onclick();">
						&nbsp;
						<!--onclick="return undo_onclick()"-->
						<INPUT id="undo" class="button3" type="button" value=" Undo " name="undo" onclick="return undo_onclick()">
						&nbsp;
						<!-- onclick="return Button2_onclick()"-->
						<INPUT id="button2" class="button3" type="button" value=" Clear " name="Button2" onclick="return Button2_onclick()">
					</TD>
				</TR>
			</TABLE>
		</TD>
	</TR>
	<TR bgcolor="AliceBlue">
		<TD colspan="5" class="heading2"><IMG src="<%#VirtualDirectory%>/images/spacer.gif" height="1"></TD>
	</TR>
	<TR>
		<TD width="100%">
			<TABLE CLASS="TABLEBG" CELLSPACING="1" CELLPADDING="5" WIDTH="100%" BORDER="0" ID="Table7">
				<TR CLASS="N-TopRowBG">
					<TD CLASS="runtext1" height="150">
						<table width="100%" ID="Table9" height="100%" bgcolor="#808080" cellspacing="1" border="0">
							<tr>
								<td bgcolor="#d4d0c8" width="15">&nbsp;</td>
								<td bgcolor="#d4d0c8" valign="middle" height="20">Show reports where..</td>
							</tr>
							<tr>
								<TD bgcolor="#d4d0c8" width="15">&nbsp;</TD>
								<td valign="top" bgcolor="White">
									<div id="exprstr" name="exprstr">&nbsp;</div>
									<input type=hidden name="displayquerybuildervaluehidden" value="<%#displayquerybuildervaluehidden%>">
									<input type=hidden name="querybuildervaluehidden" value="<%#querybuildervalue%>">
									<input type=hidden name="ResourcesExpression" value="">
									<input type=hidden name="ResourcesDispExpression" value="">
								</td>
							</tr>
						</table>
					</TD>
				</TR>
			</TABLE>
		</TD>
	</TR>
	<TR align="center" valign="top" Class="N-MainBGColor">
		<TD COLSPAN="5" CLASS="RUNTEXT1">
			<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" ID="Table8">
				<TR>
					<TD WIDTH="100%" class="runtext1" align="center">
						<a href="#" onclick="OpenSqlQuery()" class="heading3">View Sql Query</A>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<INPUT type="submit" value=" Show Report " class="button2" name="btnSearch" ID="Submit1" onclick="return SetDynamicValues()">
					</TD>
				</TR>
			</TABLE>
		</TD>
	</TR>
	<TR>
		<TD bgcolor="#d4d0c8"><IMG SRC="<%#VirtualDirectory%>/images/spacer.gif" WIDTH="10" HEIGHT="10"></TD>
	</TR>
</TABLE>
<SCRIPT>



			//Dynacmic drop downs
			var OperatorsArray = new Array();
			function Operators(QueryName, OperatorName,OperatorValue)
			{
				rExp = /@!@#/g
				ramp= /&amp;/g
				rlt= /&lt;/g
				rgt= /&gt;/g
				rquot=/&quot;/g
				this.QueryName = QueryName;
				this.OperatorName = OperatorName.replace(rExp,"'").replace(ramp,"&").replace(rlt,"<").replace(rgt,">")
				this.OperatorValue = OperatorName.replace(rExp,"'").replace(ramp,"&").replace(rlt,"<").replace(rgt,">");
			}
			//dynamic drop downs
			var FieldsArray = new Array();
			function Fields(QueryName, FieldName, FieldValue, WorkflowFlag,FieldMessage)
			{
				rExp = /@!@#/g
				ramp= /&amp;/g
				rlt= /&lt;/g
				rgt= /&gt;/g
				rquot=/&quot;/g
				this.QueryName = QueryName;
				this.FieldName   = FieldName.replace(rExp,"'").replace(ramp,"&").replace(rlt,"<").replace(rgt,">");
				this.FieldValue  = FieldValue.replace(rExp,"'").replace(ramp,"&").replace(rlt,"<").replace(rgt,">");
				this.WorkflowFlag = WorkflowFlag ;
				this.FieldMessage = FieldMessage.replace(rExp,"'").replace(ramp,"&").replace(rlt,"<").replace(rgt,">");
			}

		function listoperators(query)
		{
			if(query != '(')
			{
				operatorscount = document.getElementsByTagName("select")["seloperator"].length ;
				for(opt=0;opt<= operatorscount; opt++)
					{
						document.getElementsByTagName("select")["seloperator"].options[0]=null;
					}

				//alert(operatorleadflag)
				if (query != "" && typeof(query) != 'undefined')
					{
						obj = document.getElementsByTagName("select")["seloperator"] ;
						for (i=0;i<OperatorsArray.length;i++)
							{
								if ( OperatorsArray[i].QueryName == query)
									{
										f = new Option(OperatorsArray[i].OperatorName," "+ OperatorsArray[i].OperatorValue +" ",0,0);
										opcount = document.getElementsByTagName("select")["seloperator"].length ;
										eval("obj.options["+opcount+"]=f");
									}
							}
					}
					listfields(query);
			}
		}
		function listfields(query)
		{

			//Change the default display
			changeDiv('defaultdiv');

			fieldscount = document.getElementsByTagName("select")["selvalue"].length ;
			for(opt=0;opt<= fieldscount; opt++)
				{
					document.getElementsByTagName("select")["selvalue"].options[0]=null;
				}
			f = new Option('Select Field Type','defaultdiv',0,0);
			obj = document.getElementsByTagName("select")["selvalue"] ;
			eval("obj.options[0]=f");
			//alert(operatorleadflag)
			if (query != "" && typeof(query) != 'undefined')
				{
					obj = document.getElementsByTagName("select")["selvalue"] ;
					for (i=0;i<FieldsArray.length;i++)
						{
							if ( FieldsArray[i].QueryName == query)
								{
									f = new Option(FieldsArray[i].FieldName,FieldsArray[i].FieldValue+"#"+FieldsArray[i].FieldMessage,0,0);
									opcount = document.getElementsByTagName("select")["selvalue"].length ;
									eval("obj.options["+opcount+"]=f");
								}
						}
				}
		}
		function ChangeInputField(displaydiv)
		{
			changeDiv(displaydiv);

		}
		var oexpr2;

		oexpr2 = document.getElementsByTagName("div")["expr2"];
		function changeDiv( divvar )
		{
			if( !oexpr2 )
				oexpr2 = document.getElementsByTagName("div")["expr2"];
			//Display text messages along with value, message is appended to the select value with # as the seperator
			oexpr2.innerHTML = eval(((divvar.split("#"))[0])) +"<br><span id=messageDisp style='position:relative;face:verdana'></span>";
			//Show the message only if valid.
			if(typeof(((divvar.split("#"))[1])) != 'undefined' && typeof(((divvar.split("#"))[1])) != "")
				messageDisp.innerHTML = ((divvar.split("#"))[1])

		}
		function GetLoopValue(from,to,increment,selectval)
		{
			var string="";
			for(j=from ;j <= to ;  j=(j+increment))
			{
				if(selectval == j )
					string += "<option value='"+j+"' selected>"+j+"</option>"
				else
					string += "<option value='"+j+"'>"+j+"</option>"
			}
			return string;
		}
</SCRIPT>
<script language="javascript">
	<%#operatorsarray%>
	<%#fieldsarray%>

	var defaultdiv = "";
	var Valuediv = "<input id='valueinput' type='text' class='input1'>";
	var Resourcediv = "<input id='valueinput' type='hidden'> &nbsp; <input type=button name='btnopenresource' value='' style='height:15;width:15' onclick='javascript:openresourcewindow()'>";
	var DateTimediv = "<input id='valueinput' type='hidden'> &nbsp;";
		date = new Date();
		DateTimediv += "<SELECT id='month' class='select1'>";
		DateTimediv += GetLoopValue(1,12,1,(date.getMonth() + 1));
		DateTimediv += "</SELECT> &nbsp;"
		DateTimediv += "<SELECT id='day' class='select1'>";
		DateTimediv += GetLoopValue(1,31,1,date.getDate());
		DateTimediv += "</SELECT> &nbsp;"
		DateTimediv += "<SELECT id='year' class='select1'>";
		DateTimediv += GetLoopValue(2003,(2003+100),1,date.getFullYear());
		DateTimediv += "</SELECT> &nbsp;"
	<%#valuedropdown%>
</script>
<script language="javascript">
		var i=0;
		var oexprstr;
		var sExpression="<%#querybuildervalue%>";
		var sDispExpression="<%#displayquerybuildervaluehidden%>";
		var iOpenBrackets=0;

		var undoExpression;
		var undoDispExpression;
		var undoOpenBrackets;
function Button1_onclick()
{
	var retval=false;

			var oselquery = document.getElementsByTagName("select")["selquery"];
			var selqueryvalues = oselquery.value.split(",");

			if( selqueryvalues[0] == "(" )
			{
				set_undovalues();
				sExpression += "(";
				sDispExpression += "(";
				iOpenBrackets++;
			}
			else
			{
				var oseloperator = document.getElementsByTagName("select")["seloperator"];
				var oselvalue = document.getElementsByTagName("select")["selvalue"];
				if(oseloperator.value == "" || ((oselvalue.value.split("#"))[0])=="" || ((oselvalue.value.split("#"))[0])=="defaultdiv")
				{
					alert('Invalid selection.');
					return false;
				}

				//For IE 5.5 compatibility
				//var o = document.getElementsByTagName("*")["valueinput"];
				if(typeof(document.getElementsByTagName("input")["valueinput"]) != 'undefined')
					var o = document.getElementsByTagName("input")["valueinput"];
				else if(typeof(document.getElementsByTagName("select")["valueinput"]) != 'undefined')
					var o = document.getElementsByTagName("select")["valueinput"];
				else
					var o = document.getElementsByTagName("*")["valueinput"];
				if(((oselvalue.value.split("#"))[0]) == "DateTimediv")
				{
					if(!ValidateDateStr(document.getElementsByTagName("*")["day"].value +"/"+  document.getElementsByTagName("*")["month"].value  +"/"+ document.getElementsByTagName("*")["year"].value))
					{
						alert('Please select a valid Date');
						return false;
					}
					else
					{
						o.value = "Value."+ document.getElementsByTagName("*")["month"].value +"/"+ document.getElementsByTagName("*")["day"].value +"/"+ document.getElementsByTagName("*")["year"].value
					}
				}
				var oselcondition = document.getElementsByTagName("select")["selcondition"];
				if(trim(o.value) == "" || typeof(o.value) == 'undefined')
				{
					alert('Invalid value.');
					return false;
				}
				//If question mark is entered , other values should not co-exist with the ?.
				if(trim(o.value).indexOf("?") >= 0 && trim(o.value) != "?")
				{
					alert('Invalid value.');
					return false;
				}
				var endcond=false;

				if( oselcondition.value.substring(0,1) == ")" ) //Incase no open brackets pending dont allow to close the bracket
					if( iOpenBrackets <= 0 )
						return retval;
					else
						iOpenBrackets--;


				if( oselcondition.value == "End" )
					endcond=true;

				set_undovalues();
				sExpression += "["; sDispExpression += "[";
				sExpression += selqueryvalues[0]; sDispExpression += oselquery.options[oselquery.selectedIndex].text;
				sExpression += "]"; sDispExpression += "]";
				sExpression += oseloperator.value; sDispExpression += oseloperator.value;
				sExpression += "["; sDispExpression += "[";
				if( ((oselvalue.value.split("#"))[0]) != "Valuediv" )
				{
					//If resource div is selecetd then load the valeus from resource hidden fields
					if(((oselvalue.value.split("#"))[0]) == "Resourcediv")
					{
						sExpression += '"'+ document.getElementsByTagName("input")["ResourcesExpression"].value +'"';
						sDispExpression += '"'+ document.getElementsByTagName("input")["ResourcesDispExpression"].value +'"';
					}
					else
					{
						if(typeof(((o.value.split(","))[1])) == 'undefined')
						{
							sExpression += ((o.value.split(","))[0]).replace("^","'");
						}
						else
						{
							sExpression += ((o.value.split(","))[1]).replace("^","'");
						}
						sDispExpression += '"'+ ((o.value.split(","))[0]).replace("^","'") +'"';
					}
				}
				else
				{

				 	//Checking for dynamic input
				 	if(o.value == "?")
				 		sExpression += '"'+selqueryvalues[0] +'.'+trim(o.value)+'"';
				 	else
				 		sExpression += "Value."+ trim(o.value) ;

					sDispExpression += '"'+trim(o.value)+'"';
				}

				sExpression += "]"; sDispExpression += "]";

				if( !endcond )
				{
					sExpression += " "+oselcondition.value;
					sDispExpression += " "+oselcondition.value;
				}
				else
				{
					while( iOpenBrackets > 0)
					{
						sExpression += ")"; sDispExpression += ")";
						iOpenBrackets--;
					}
					document.getElementsByTagName("input")["Button1"].disabled=true; //Disable Add button
					document.getElementsByTagName("input")["btnSaveSet"].disabled=false;
					document.getElementsByTagName("input")["btnSearch"].disabled=false;

				}
			}
			show_expression(sDispExpression);
			return retval;
}
	function show_expression(expression)
		{
			if( !oexprstr )
				get_framediv();
			if(typeof(expression) != 'undefined')
			{
				expression = expression.replace("Value.","").replace("Row.","").replace("Resource.^","").replace("^","");
				oexprstr.innerHTML = expression;
				document.getElementsByTagName("input")["querybuildervaluehidden"].value =  sExpression;
				document.getElementsByTagName("input")["displayquerybuildervaluehidden"].value =  expression;
			}

		}
	function SetQueryBuilderValue()
	{
		var StrValue="";
		StrValue = document.getElementsByTagName("input")["displayquerybuildervaluehidden"].value;
		if(StrValue != "")
		{
			if( !oexprstr )
				get_framediv();
			oexprstr.innerHTML = StrValue;
		}
	}
	function set_undovalues()
	{
		undoExpression = sExpression;
		undoDispExpression = sDispExpression;
		undoOpenBrackets = iOpenBrackets;
		document.getElementsByTagName("input")["undo"].disabled=false;
	}
	function get_framediv()
	{
		var framedoc;
		var frameobj;

		if(navigator.userAgent.indexOf("Netscape") >0 )
		{
			document.all = document.getElementsByTagName("iframe");
			frameobj = document.all["expr"];
			oexprstr= document.all["exprstr"];
			//framedoc = frameobj.contentDocument.getElementsByTagName("*");
			//oexprstr = framedoc["exprstr"];
		}
		else
		{
			frameobj = document.frames["expr"];
			oexprstr = document.all["exprstr"];
		}

	}
	function init()
	{
		document.getElementsByTagName("input")["undo"].disabled=true;
		if( sExpression != "" )
		{
			document.getElementsByTagName("input")["Button1"].disabled=true; //Disable Add button
			document.getElementsByTagName("input")["btnSaveSet"].disabled=true;
		}
		else
		{
			document.getElementsByTagName("input")["Button1"].disabled=false; //Enable Add button
			document.getElementsByTagName("input")["btnSaveSet"].disabled=true;
			document.getElementsByTagName("input")["btnSearch"].disabled=true;

		}
		show_expression(sDispExpression);
	}
	function Button2_onclick()
	{
		sExpression="";
		sDispExpression="";
		iOpenBrackets=0;
		if(typeof(document.getElementsByTagName("input")["valueinput"]) != "undefined")
			document.getElementsByTagName("input")["valueinput"].value =""
		document.getElementsByTagName("input")["ResourcesExpression"].value =""
		document.getElementsByTagName("input")["ResourcesDispExpression"].value =""
		document.getElementsByTagName("input")["Button1"].disabled=false; //Enable Add button
		document.getElementsByTagName("input")["btnSaveSet"].disabled=true;
		document.getElementsByTagName("input")["btnSearch"].disabled=true;
		show_expression(sDispExpression);
	}
	function undo_onclick()
	{
		sExpression = undoExpression;
		sDispExpression = undoDispExpression;
		iOpenBrackets = undoOpenBrackets;
		document.getElementsByTagName("input")["undo"].disabled=true; //Disable undo button
		document.getElementsByTagName("input")["Button1"].disabled=false; //Enable Add button
		document.getElementsByTagName("input")["btnSaveSet"].disabled=true;
		document.getElementsByTagName("input")["btnSearch"].disabled=true;
		show_expression(sDispExpression);
	}

	function openresourcewindow()
	{

		Urlval = "?display=resourcefilter&application=<%#applicationnameresourcefilter%>&workflow=<%#workflowname%>&reporttype=<%#reporttypefilter%>&datecorrectionfactor=<%#datecorrectionfactor%>"
		window.open(Urlval,"ResourceFilter","height=300,width=650,resizable=yes")
	}

	function GoBack()
	{
		var urlval = window.location.href;
		if(location.href.indexOf('?') > 0 )
			{

				//if(location.href.indexOf("=merge") > 0 )
				//	document.getElementsByTagName("input")["display"].value="merge"
				//	urlval = urlval.substring(0,urlval.indexOf("?")) + "?display=merge&applicationsel=<%#applicationsel%>&workflowsel=<%#workflowsel%>";
				//else
				//	urlval = urlval.substring(0,urlval.indexOf("?")) + "?applicationsel=<%#applicationsel%>&workflowsel=<%#workflowsel%>";
			}
		//window.location.href= urlval;
		document.getElementsByTagName("input")["display"].value="";
		document.getElementsByTagName("input")["reporttype"].value="";
		document.forms[0].submit();
	}
	function SetName()
	{

		newurl = "?display=savereportset&application=<%#applicationnameresourcefilter%>&workflow=<%#workflowname%>&reporttype=<%#reporttypefilter%>&datecorrectionfactor=<%#datecorrectionfactor%>&querybuildervalue="+ document.getElementsByTagName("input")["querybuildervaluehidden"].value;
		window.open(newurl,"SaveReportSet","height=300,width=650,resizable=yes")
	}
	function OpenSqlQuery()
	{
		newurl = "?display=reportqueryviewer&application=<%#applicationnameresourcefilter%>&workflow=<%#workflowname%>&reporttype=<%#reporttypefilter%>&datecorrectionfactor=<%#datecorrectionfactor%>&querybuildervalue="+ document.getElementsByTagName("input")["querybuildervaluehidden"].value;
		window.open(newurl,"SaveReportSet","height=500,width=750,resizable=yes")
	}
	function SetDynamicValues()
	{
		queryval = document.getElementsByTagName("input")["querybuildervaluehidden"].value;
		queryval = trim(queryval);
		if(queryval == "")
		{
			alert('Please set a Query.')
			return false;
		}
		else
		{
			if(queryval.indexOf("?") >= 0 )
			{
				newurl = "?display=assigndynamicvalue&application=<%#applicationnameresourcefilter%>&workflow=<%#workflowname%>&reporttype=<%#reporttypefilter%>&datecorrectionfactor=<%#datecorrectionfactor%>&ReportSetIdentifier="+ document.getElementsByTagName("select")["selsavedsearch"].value +"&querybuildervalue="+ document.getElementsByTagName("input")["querybuildervaluehidden"].value +"&querybuilderdispvalue="+ document.getElementsByTagName("input")["displayquerybuildervaluehidden"].value;
				window.open(newurl,"SetReportSet","height=300,width=650,resizable=yes")
				return false;
			}
			else
			{
				return true;
			}
		}
	}
	function SetReportSet(value,objform)
	{
		if(value == 0)
		{
			alert('Please select a valid value.');
		}
		else
		{
			if(value == -1)
			{
				newurl = "?display=deletereportset&application=<%#applicationnameresourcefilter%>&workflow=<%#workflowname%>&reporttype=<%#reporttypefilter%>&datecorrectionfactor=<%#datecorrectionfactor%>";
				window.open(newurl,"DeleteReportSet","height=300,width=650,resizable=yes")

			}
			else
			{
				document.getElementsByTagName("input")["ReportSetIdentifier"].value=value;
				objform.submit();
			}
		}
	}

	//call function to show to querybuilder value after submission
	SetQueryBuilderValue();
	init();
</script>
